<include file="layout/header" />
    <script>
        function changeYear(){
            var year = document.getElementById('c_date').value;
            var url = '__APP__/Admin/Index/index/c_date/' + year;
            window.location.href = url;
        }

        function viewContractList(f,c){
            var url = '__APP__/Admin/Contract/mobileView';
            url = url + '/flag/' + f + '/c_date/' + c;
            window.location.href = url;
        }
    </script>
            <!-- Right side column. Contains the navbar and content of the page -->
            <aside class="right-side">
                <section class="content-header">
                    <h1>
                        概况
                        <small>Generally</small>
                    </h1>
                </section>
                <section class="content">
                    <div class="row">
                        <div class="col-xs-12">
                            <div class="box">
                                <div class="text-center">销售查询:</div>
                                <form method="post" action="__APP__/Admin/ContractPlus/searchViewList">
                                    <div class="input-group margin box-body">
                                        <span class="input-group-btn">
                                          <label>产品规格：</label>
                                        </span>
                                        <input type="text" class="form-control" name="c_guige" placeholder="请输入查找的产品规格...">
                                        <span class="input-group-btn">
                                          <button type="submit" class="btn btn-info btn-flat" onclick="">查询</button>
                                        </span>
                                    </div>
                                </form>
                                <form method="post" action="__APP__/Admin/ContractPlus/searchPname">
                                    <div class="input-group margin box-body">
                                        <span class="input-group-btn">
                                          <label>需求单位：</label>
                                        </span>
                                        <input type="text" class="form-control" name="p_name" placeholder="请输入查找的单位/公司名称...">
                                        <span class="input-group-btn">
                                          <button type="submit" class="btn btn-info btn-flat" onclick="">查询</button>
                                        </span>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-12">
                            <div class="box">
                                <div class="text-center">模具查询:</div>
                                <form method="post" action="__APP__/Admin/Moulds/searchViewList">
                                    <div class="input-group margin box-body">
                                        <input type="text" class="form-control" name="m_guige" placeholder="请输入查找的模具规格...">
                                        <span class="input-group-btn">
                                          <button type="submit" class="btn btn-info btn-flat" onclick="">查询</button>
                                        </span>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-12">
                            <div class="box">
                                <div class="box-body table-responsive">
                                    <table id="example2" class="table table-bordered table-hover text-left">
                                        <thead>
                                            <tr>
                                                <th class="col-xs-2 text-center">合同款项</th>
                                                <th class="col-xs-10 text-center">
                                                    <select id="c_date" class="form-control" onchange="changeYear()">
														<if condition="$c_date eq ''">
                                                        <option value="">请选择年份</option>
														<else />
														<option value="{$c_date}">{$c_date}</option>
														</if>
														<option value="">所有年份</option>                                                    
                                                        <option value="{$c_date-3}">{$c_date-3}</option>
                                                        <option value="{$c_date-2}">{$c_date-2}</option>
                                                        <option value="{$c_date-1}">{$c_date-1}</option>
														<option value="{$c_date+1}">{$c_date+1}</option>
														<option value="{$c_date+2}">{$c_date+2}</option>
                                                        <option value="{$c_date+3}">{$c_date+3}</option>
                                                </th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr>
                                                <td class="text-center">合同总数:</td>
                                                <td class="text-left">{$contractCount}</td>
                                            </tr>
                                            <tr>
                                                <td class="text-center">合同总金额:</td>
                                                <td class="text-left">{$contractPrice}</td>
                                            </tr>
                                            <tr>
                                                <td class="text-center">已回款合同数:</td>
                                                <td class="text-left">【 {$hasContractCount} 】<a href="#" class="navbar-link" onclick="viewContractList('1','{$c_date}')">点击查看详情...</a></td>
                                            </tr>
                                            <tr>
                                                <td class="text-center">已回款金额:</td>
                                                <td class="text-left">{$hasContractPrice}</td>
                                            </tr>
                                            <tr>
                                                <td class="text-center">未收合同数:</td>
                                                <td class="text-left">【 {$contractCount-$hasContractCount} 】<a href="#" class="navbar-link" onclick="viewContractList('0','{$c_date}')">点击查看详情...</a></td>
                                            </tr>
                                            <tr>
                                                <td class="text-center">未收款金额:</td>
                                                <td class="text-left">{$contractPrice-$hasContractPrice}</td>
                                            </tr>
                                            <tr>
                                                <td class="text-center">回款率</td>
                                                <td class="text-left">{$hasContractPrice / $contractPrice * 100|round=###,3}%</td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-12">
                            <div class="box">
                                <div class="box-body table-responsive">
                                    <table id="example2" class="table table-bordered table-hover text-left">
                                        <thead>
                                        <tr>
                                            <th class="col-xs-2 text-center">经营成本</th>
                                            <th class="col-xs-10 text-center"></th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr>
                                            <td class="text-center">人工成本</td>
                                            <td class="text-left">{$paytotal}</td>
                                        </tr>
                                        <tr>
                                            <td class="text-center">原料成本</td>
                                            <td class="text-left">数值</td>
                                        </tr>
                                        <tr>
                                            <td class="text-center">管理成本</td>
                                            <td class="text-left">数值</td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </section>
            </aside><!-- /.right-side -->
<include file="layout/footer" />
